import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { ContractSubmissionVO, ContractSubmissionForm, ContractSubmissionQuery } from '@/pagesA/api/workflow/contractSubmission/types';

/**
 * 查询合同提报列表
 * @param query
 * @returns {*}
 */

export const listContractSubmission = (query?: ContractSubmissionQuery): AxiosPromise<ContractSubmissionVO[]> => {
  return request({
    url: '/workflow/contractSubmission/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询合同提报详细
 * @param id
 */
export const getContractSubmission = (id: string | number): AxiosPromise<ContractSubmissionVO> => {
  return request({
    url: '/workflow/contractSubmission/' + id,
    method: 'get'
  });
};

/**
 * 新增合同提报
 * @param data
 */
export const addContractSubmission = (data: ContractSubmissionForm) => {
  return request({
    url: '/workflow/contractSubmission',
    method: 'post',
    data: data
  });
};

/**
 * 修改合同提报
 * @param data
 */
export const updateContractSubmission = (data: ContractSubmissionForm) => {
  return request({
    url: '/workflow/contractSubmission',
    method: 'put',
    data: data
  });
};

/**
 * 删除合同提报
 * @param id
 */
export const delContractSubmission = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/contractSubmission/' + id,
    method: 'delete'
  });
};
